﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using TodoApp.Dto;
using Volo.Abp.Application.Services;
using Volo.Abp.Uow;

namespace MySystemSetup.IUser
{
    public interface IUserInfoAppService:IApplicationService
    {





        //删除用户
        Task DeleteAsync(string id);

        /// 添加用户
        Task<SzrApiResult<UserDto>> AddAsync(UserDto userDto);

        //分页显示用户列表

        Task<SzrApiPageResult<UserDto>> PageGetList(int page, int limit, string? quNumber);

        //用户登录
        Task<SzrApiResult<UserLogDto>> UserLog(UserLogDto dto);



        /// <summary>
        /// 验证
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        /// 

        Task<FileStreamResult> GetCaptcha(string id);

      

        
        Task<SzrApiResult<UserShowDto>> GetUserInfo(string id);//个人信息显示


        /// <summary>
        /// 修改用户名
        /// </summary>
        /// <param name="dto">修改需要的信息</param>
        /// <returns>统一返回格式</returns>
        Task<SzrApiResult<UserLogDto>> UpdateUserName(UserLogDto dto);


        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="dto">用户Dto</param>
        /// <returns>统一返回格式</returns>
        Task<SzrApiResult<UpdatePwdDto>> UpdateUserPwd(UpdatePwdDto dto);

        /// <summary>
        /// 修改手机号
        /// </summary>
        /// <param name="uTel">手机号</param>
        /// <param name="code">验证码</param>
        /// <returns></returns>
        Task<SzrApiResult<UserShowDto>> UpdateTelInforLogin(string? uTel, string? code, string id);

        /// <summary>
        /// 获取到手机号验证登录码
        /// </summary>
        /// <param name="uTel"></param>
        /// <returns></returns>
        Task<SzrApiResult<UserShowDto>> GetTelLogin(string? uTel);

        /// <summary>
        /// 修改手机号
        /// </summary>
        /// <param name="uTel">手机号</param>
        /// <param name="code">验证码</param>
        /// <returns></returns>
         Task<SzrApiResult<UserShowDto>> UpdateNewPhone(string? uTel, string? code, string id);

        /// <summary>
        /// 注销账号
        /// </summary>
        /// <param name="uTel">手机号</param>
        /// <param name="code">验证码</param>
        /// <returns>统一返回格式</returns>
        Task<SzrApiResult<UserShowDto>> UpdateUserSate(string id, string pwd);


        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="dto">要添加的实体</param>
        /// <returns>统一返回格式</returns>
        Task<SzrApiResult<UserShowDto>> AddUserinfo(AddUserInfoDto dto);

        /// <summary>
        /// 分页显示用户列表
        /// </summary>
        /// <param name="userName">用户姓名</param>
        /// <param name="dId">用户部门</param>
        /// <param name="statu">用户状态</param>
        /// <param name="page">当前页</param>
        /// <param name="limit">页容量</param>
        /// <param name="uId">用户编号</param>
        /// <returns>统一返回格式</returns>
        Task<SzrApiPageResult<UserShowDto>> GetUserInfoPageShowAsync(string? userName, int dId, int statu, int page, int limit, string uId);



        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="uId">登录用户编号</param>
        /// <param name="delUId">要删除的用户编号</param>
        /// <returns>统一返回格式</returns>
        [UnitOfWork]
         Task<SzrApiResult<UserShowDto>> DeleteShowAsync(string uId, string? delUId);



        /// <summary>
        /// 图片上传
        /// </summary>
        /// <param name="file">文件</param>
        /// <returns>返回格式</returns>

        SzrApiResult<string> UploadImg(IFormFile file);
    }
}
